package com.demo.jpa.dao.entity;

import io.swagger.models.auth.In;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

/**
 * @Author:liaoyoule
 * @Description
 * @Date: Created in 15:51 2018/7/20
 * @Modifyied By:
 */
@Setter
@Getter
@Entity
@Table(name = "user")
@NamedQueries(
        @NamedQuery(name = "UserEntity.findByPassword", query = "select o from UserEntity o")
)
@NamedNativeQueries(
        @NamedNativeQuery(name = "UserEntity.findAllByNativeQuery", query = "select username FROM user")
)
public class UserEntity {
    @Id
    private Integer uid;
    @Column
    private String username;
    @Column
    private String password;
    @Column
    private Integer age;



    @Override
    public String toString() {
        return username;
    }
}
